package fun.tan90.easy.binlog.manager.dataobject.listener;

import cn.dev33.satoken.stp.StpUtil;
import com.mybatisflex.annotation.UpdateListener;
import fun.tan90.easy.binlog.manager.dataobject.BinlogMaster;

import java.util.Date;

/**
 * description TODO
 * company 铁人科技
 *
 * @author 陈浩杰
 * @date 2023/9/5 17:40
 */
public class BinlogMasterUpdateListener implements UpdateListener {

    @Override
    public void onUpdate(Object entity) {
        BinlogMaster binlogMaster = (BinlogMaster) entity;
        binlogMaster.setUpdateId(String.valueOf(StpUtil.getLoginId()));
        binlogMaster.setUpdateTime(new Date());
    }
}
